<include file="Public:header"/>

<div class="contract_detail">
	<div class="wrap">
		<h2>{$info['title']}</h2>
		<div class="percentage">
			<div style="width:{$step_info['progress'] == 0 ? '10' : $step_info['progress']}%;">
				完成{$step_info['progress']}%
			</div>
		</div>
		<div class="clearfix content">
			<form action="{:U('step', array('agreement_id' => $agreement_id, 'step' => $next_step))}" method="post">
			<div class="fl">
				<div class="form">
					<h3>{$step_info['step_title']}</h3>
					<volist name="ask_data" id="rs">
					<div class="row">
						<neq name="rs.type" value="group_info">
							<div class="title">
								<span class="t_fl">{$rs['title']}</span>
								<neq name="rs.description" value="">
								<em class="btn_ask">
									<div class="ask_tips">
										<p>{$rs['description']}</p>
									</div>
								</em>
								</neq>
							</div>
						</neq>
						<div class="enter">
							<php>
								$list = explode(PHP_EOL, $rs['content']);
							</php>
							<switch name="rs.type" >
								<case value="text">
									<input type="text" name="answer[{:md5($rs['name'])}]" value="{$cache_answer[md5($rs['name'])]|default=$rs['content']}" class="text" style="width: 300px" />
								</case>
								<case value="textarea">
									<textarea name="answer[{:md5($rs['name'])}]" style="height: 100px;">{$cache_answer[md5($rs['name'])]|default=$rs['content']}</textarea>
								</case>
								<case value="date">
									<input type="text" name="answer[{:md5($rs['name'])}]" value="{$cache_answer[md5($rs['name'])]|default=$rs['content']}" class="text" onclick="WdatePicker()" style="width: 80px;" />
								</case>
								<case value="datetime">
									<input type="text" name="answer[{:md5($rs['name'])}]" value="{$cache_answer[md5($rs['name'])]|default=$rs['content']}" class="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" style="width: 120px;" />
								</case>
								<case value="radio">
									<volist name="list" id="val">
										<label>
											<input type="radio" name="answer[{:md5($rs['name'])}]" value="{$val}" <eq name="val" value="$cache_answer[md5($rs['name'])]">checked</eq> />
											{$val}
										</label>
									</volist>
								</case>
								<case value="radio_text">
									<volist name="list" id="val">
										<div class="radio-text">
											<label>
												<input type="hidden" name="answer[{:md5($rs['name'])}][type]" value="radio-text">
												<input type="radio" name="answer[{:md5($rs['name'])}][val]" value="{$i}" <eq name="i" value="$cache_answer[md5($rs['name'])]['val']">checked</eq> />
												<input type="text" class="text" name="answer[{:md5($rs['name'])}][{$i}][text]" value="{$cache_answer[md5($rs['name'])][$i]['text']|default=$val}" style="width: 600px" />
											</label>
										</div>
									</volist>
								</case>
								<case value="checkbox">
									<volist name="list" id="val">
										<php>
											$is_checked = in_array($val, $cache_answer[md5($rs['name'])]);
										</php>
										<label>
											<input type="checkbox" name="answer[{:md5($rs['name'])}][]" value="{$val}" <eq name="is_checked" value="1">checked</eq> />
											{$val}
										</label>
									</volist>
								</case>
								<case value="select">
									<select name="answer[{:md5($rs['name'])}]">
										<volist name="list" id="val">
											<option value="{$val}" <eq name="val" value="$cache_answer[md5($rs['name'])]">selected</eq>>{$val}</option>
										</volist>
									</select>
								</case>
								<case value="description">
								
								</case>
								<case value="group_info">
									<input type="hidden" name="answer[{:md5($rs['name'])}][]" value="ask-group-info">
									<input type="hidden" name="answer[{:md5($rs['name'])}][]" value="{$rs['content']}">
									<fieldset style="border: 1px solid #dcdcdc; width: 300px; padding: 20px;">
										<legend>{$rs['title']}</legend>
										<volist name="list" id="val">
											<p> {$val} </p>
											<p>
												<input type="text" name="answer[{:md5($rs['name'])}][]" value="{$cache_answer[md5($rs['name'])][$i+1]}" class="text" style="width: 150px" />
											</p>
										</volist>
									</fieldset>
								</case>
								<default />
									<input type="text" name="answer[{:md5($rs['name'])}]" value="{$cache_answer[md5($rs['name'])]|default=$rs['content']}" class="text" style="width: 200px" />
							</switch>
						</div>
					</div>
					</volist>
				</div>
				<div class="clearfix operate">
					<a class="btn_back" href="javascript:history.go(-1);">上一步</a>
					<input class="btn_next" type="submit" value="下一步">
					<a class="btn_next submit-form" href="{:U('get_preview_data', array('agreement_id' => $agreement_id))}" form-class="form" to-data="preview-data div">更新预览</a>
				</div>
			</div>
			</form>
			<div class="fr">
				<dl>
					<dt>填写说明</dt>
					<dd>{:nl2br($step_data['description'])}</dd>
					<dd style="color: #FD8920">若您在使用生成过程中遇到了任何问题，欢迎点击下方问题反馈按钮将问题反馈给我们</dd>
					<dd style="">
						填写或使用如有疑问，点击
						<a class="win" href="{:U('Feedback/win_submit', array('object_id' => $agreement_id))}" style="color: #2894d2">反馈问题</a>
					</dd>
				</dl>
			</div>
			<div class="preview_show">
				<div class="thumb_img preview-data">
					<img src="/Public/Images/agreement-bg.png" class="agreement-water" alt="" />
					<div>
						<p class="title">{$info['title']}</p>
						<p>&nbsp;</p>
						<p style="color: #ff0000">
							(声明：1、生成后格式为Word，无Logo、无水印；2、本声明文字可在下载后自行删除；3、生成过程中的提示，仅是基于通常情况下合同条款的示范，不能视为是米律的指导意见；4、合同文本及具体条款，不是标准及最终法律文本，仅供参考，米律建议根据实际情况，在法律专业人士的指导下进行修改后才使用，米律就在线生成的合同不承担任何法律责任。)
						</p>
						{$doc_content}
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<style type="text/css">
.preview_show .title{
	font-size: 28px;
	text-align: center;
	line-height: 60px;
}
.preview_show p{
	font-size: 14px;
	line-height: 200%;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
	//表单问号mouseover
	$(".btn_ask").live('hover',function(event){
		if(event.type=='mouseenter'){ 
			$(this).find(".ask_tips").show();
		}else{ 
			$(this).find(".ask_tips").hide();
		} 
	});
	$('label').click(function () {
		$(this).find('input[type="radio"]').attr('checked', 'checked');
	})
});
</script>
<style type="text/css">
.contract_detail .form .enter{
	padding-left: 5px;
}
.radio-text{
	margin-bottom: 3px;
}
</style>
<include file="Public:footer"/>
